﻿#include "AlgFixed.h"

#include "../algorithm_log.h"

AlgFixed::AlgFixed()
{
}

AlgFixed::~AlgFixed()
{
}


/*算法初始化接口*/
bool AlgFixed::Init(const AlgInit& init, const QString& other)
{
	log_trace("fixed alg init, base = ({}, {}, {}, {}, {}, {})", init.base.x, init.base.y, init.base.z,
		init.base.a, init.base.b, init.base.c);
	if (init.base.x == 0 && init.base.y == 0) {
		log_error("base is error");
		return false;
	}
	m_base = init.base;

	return true;
}

bool AlgFixed::InitSkuInfo(const AlgSkuInfo& sku, QString& result)
{
	return true;
}

bool AlgFixed::Calculate(const QString& input, Position& pos, QString& output)
{
	log_trace("Fixed alg math result = ({}, {}, {}, {}, {}, {})", m_base.x, m_base.y, m_base.z,
		m_base.a, m_base.b, m_base.c)
	pos = m_base;
	output = "OK";
	return true;
}

bool AlgFixed::ExcuteCmd(int cmd, const QString& input, QString& output)
{
	return false;
}
